• mdg
  • NEWBIE
  • 0 Points
  • Member since 2013
  • Sylpheo

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hi there !
I created a dynamic approval process and my customer found one issue (that occurred one time... over 5000 records ^^, so I was not able to reproduce it). Hope you can help me..
So the process is dynamic because rules are not static, and cannot match a classical matrix scheme. My custom object (CO__c) has a lot and a lot of fields. Some of its fields are rules for approval steps. A related list (Approver__c) is also linked to this object (look-up relationship) and is also a rule. Here is the steps :
- if user look-up field A__c != CreatedById, the approval process must start with User linked with A__c field
- Approval process must follow my related list of Approver__c record. An Approver__c record has three main fields :
  * CO__c, that links to the main record
  * Order__c, that allows to define an order between CO__c linked Approver__c (Number : 1, 2, ... , n)
  * User__c, look-up to user who will approve
- if boolean field B__c checked, then process must be approved by a given user.

My process is written in a not-standard way :
- I have a custom decimal field that acts as a counter (Approval_Step__c)
- I have an user look-up field that contains next approver (Next_Approver__c)
- My approval process has one step that send record to Next_Approver__c and post action increments Approval_Step__c
- A trigger on CO__c calculates Next_Approver__c according to Approval_Step__c and A__c, B__c, linked Approver__c records
- A process builder relaunches approval process with this main condition : Approval_Step__c is changed
- I have some other conditions (a boolean and a status) that tell when approval is ok/ko.

It works well, but one issue was discovered by my customer. In the flow, we noticed that one user approved TWO times (same time, same user, Record locked logged two times...) and an issue occurs : one user is skipped (perhaps because Approval_Step__c is incremented two times). In the chatter feed, I noticed that this user approved via SF1. I contacted SF1 support, but error doesn't seem to be linked with SF1.

Hope you can help me.

Thanks,

Marion
  • May 30, 2016
  • Like
  • 0

Hello everybody !

 

I hope you will be able to help me. 

 

I would like to parse a SOQL query to retrieve fields and tables. For now, to have a query structure, I launch it and take the first record in order to create my structure on the fly. For example :

 

SELECT Id, Name, Amount, Account.Name, Account.BillingCity FROM Opportunity

 

will return all records with following structure :

 

    Account =     {

        Name = "...";

        BillingCity = "...";

        attributes =         {

            type = Account;

            url = "/services/data/v23.0/sobjects/Account/...";

        };

    };

    Amount = ...;

    Id = ...;

    Name = "...";

    attributes =     {

        type = Opportunity;

        url = "/services/data/v23.0/sobjects/Opportunity/...";

    };

 

 It's okay for me : I can create a dictionary containing fields (Amount, Id, Name and Account which contains BillingCity and Name fields). The problem is when there is no record, or when a lookup, or a sub-request (SELECT request in select part) return null result, I cannot get structure. For example, I have :

 

    Account =   null;

    Amount = ...;

    Id = ...;

    Name = "...";

    attributes =     {

        type = Opportunity;

        url = "/services/data/v23.0/sobjects/Opportunity/...";

    };

 

In this case, I cannot get Account structure.

 

Is there a way to get this information anyway, without having to write a custom parser (which must work in more complex queries) ?

 

Thanks !

  • September 20, 2013
  • Like
  • 0

Hello everybody !

 

I hope you will be able to help me. 

 

I would like to parse a SOQL query to retrieve fields and tables. For now, to have a query structure, I launch it and take the first record in order to create my structure on the fly. For example :

 

SELECT Id, Name, Amount, Account.Name, Account.BillingCity FROM Opportunity

 

will return all records with following structure :

 

    Account =     {

        Name = "...";

        BillingCity = "...";

        attributes =         {

            type = Account;

            url = "/services/data/v23.0/sobjects/Account/...";

        };

    };

    Amount = ...;

    Id = ...;

    Name = "...";

    attributes =     {

        type = Opportunity;

        url = "/services/data/v23.0/sobjects/Opportunity/...";

    };

 

 It's okay for me : I can create a dictionary containing fields (Amount, Id, Name and Account which contains BillingCity and Name fields). The problem is when there is no record, or when a lookup, or a sub-request (SELECT request in select part) return null result, I cannot get structure. For example, I have :

 

    Account =   null;

    Amount = ...;

    Id = ...;

    Name = "...";

    attributes =     {

        type = Opportunity;

        url = "/services/data/v23.0/sobjects/Opportunity/...";

    };

 

In this case, I cannot get Account structure.

 

Is there a way to get this information anyway, without having to write a custom parser (which must work in more complex queries) ?

 

Thanks !

  • September 20, 2013
  • Like
  • 0