• PM Modi Scheme
  • NEWBIE
  • -1 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
Hi friends,

We have a date field on the Web to Case form, but it isn't populating in SFDC when the form is submitted.  I have referenced this article (https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_date_format.htm#:~:text=Valid%20Date%20Format%20in%20Records) and we have tried all of the formats recommended, however the date still doesn't want to populate in SFDC.  I have opened a case with SFDC and they said this is out of scope for support since this "isn't official salesforce documentation" and I must contact the webmaster to correct the format.  Our webmaster is in-house and we've tried all formats mentioned. 

Here is the code on the form:
the control that calls the addDateNeeded function:
        <input id="00N23000000k2js" name="00N23000000k2js" type="hidden" />
        Date Needed:&nbsp;
        <telerik:RadDatePicker ID="AppNeededByRdp" Culture="en-Us" PopupDirection="BottomRight" runat="server" Width="100px">
          <Calendar ID="Calendar3" EnableWeekends="false" runat="server"></Calendar>
          <DateInput ID="DateInput2" DateFormat="MM/dd/yyyy" OnClientDateChanged="appDateNeeded" runat="server"></DateInput>

javascript function:
function appDateNeeded(sender, args) {
    var d = args.get_newDate(); 

    if (d) {
        if (d.getDay() === 0 || d.getDay() === 6) {
            sender.set_value(""); //do not allow user to enter Sunday nor Saturday
            document.getElementById("00N23000000k2js").value = "";
        }
        else {
            var sd = args.get_newValue().split('/');

            document.getElementById("00N23000000k2js").value = sd[2] + "-" + sd[0] + "-" + sd[1];
            document.getElementById("requireappdate").style.display = "none";
        }  //
    }
    else { document.getElementById("00N23000000k2js").value = ""; }
}

Can I please have some help with finding where these don't line up?  Please let me know if you need to see more of the referenced code.

Any help is appreciated. ☺

Thank you,
Matt
  • June 24, 2020
  • Like
  • 0
I would want to write a batch class to consider some Account records which have a flag unchecked and then compare them with a duplicate Account records created with the same name which are checked to update other values. I am new to APEX please let me know how can I frame the code.
Global class myBatch implements Database.Batchable<sobject>{
    Global myBatch(){
        }
global Database.Querylocator start(Database.Bachablecontext context){

   return Database.getQuerylocator([Select ID, Name from Account where BATCH_PROCESS__c = FALSE]);
}

global void execute(Database.BatchableContext BC, List<Account> scope){
    //I would want to get those Account names which have a BATCH_PROCESS__c AS TRUE to compare 

list<Account> acc = ([Select Name from Account where BATCH_PROCESS__c = TRUE]);
    set<string> st = new set<string>();
    for(Account act: acc){
    st.add(act.name);
}
 try{
     
     for(Account active:scope){
         
         //I am struck here on how to compare the values from the string
     }
  }catch(Exception e){}
}
}

 
Hi,

I set up a CMS connection in my Community.
I used these settings:
CMS Source: Drupal
Connection type public:
Server URL: https://drupdemoeight8wnpr4ekpl.devcloud.acquia-sites.com

JSON:
Content list: 
- Name: List
- Path: content/rest?_format=json
- Node Path: nothing

When using the component CMS Connect JSON with the default values I see: "The server returned code HTTP 0"

I can confirm that my Rest service is well configures by testing it with Postman or even directly in the browser:
https://drupdemoeight8wnpr4ekpl.devcloud.acquia-sites.com/content/rest?_format=json

Any idea of what is wrong or how I could debug that?

Can we test the CMS connection?

Cheers,
Laurent