apex-enterprise-patterns / force-di

Generic DI library with support for Apex, Triggers, Visualforce and Lightning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BindingObjectAlternate__c is not working

dinobrinas opened this issue · comments

BindingObjectAlternate__c is not working when I put a value on it. I am using this on the Task object for binding object but cannot find it in the list. So I decided to use BindingObjectAlternate__c but no luck.
When I check the code, It's not included in the select statement and in the if statement. Please see below screenshot:
image

Please let me know if you know how to fix this.

Thanks and regards,
Divino Brinas

@dinobrinas -- Thanks for reporting this. I am looking at it now and can reproduce the issue. Should have a fix soon. Cheers!

@dinobrinas -- Just wanted to let you know that I have not forgotten this one. Working on solution. Hopefully have something soon.

@dinobrinas -- Can you post two things please?

  • A copy of the Binding__mdt record
  • A copy of how you are making the call to get the bindings
    Thanks for the help.

Thanks for your reply.

We would like to ask your estimate when can we expect the changes based on this bug?

Please see screenshot and metadata record from Binding__mdt:
image

<?xml version="1.0" encoding="UTF-8"?> <CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <label>MEX_UserTriggerHandler</label> <protected>false</protected> <values> <field>BindingObjectAlternate__c</field> <value xsi:type="xsd:string">User</value> </values> <values> <field>BindingObject__c</field> <value xsi:nil="true"/> </values> <values> <field>BindingSequence__c</field> <value xsi:nil="true"/> </values> <values> <field>To__c</field> <value xsi:type="xsd:string">MEX_UserTriggerHandler</value> </values> <values> <field>Type__c</field> <value xsi:type="xsd:string">Apex</value> </values> </CustomMetadata>

@dinobrinas -- Thanks for the above. The fix is pretty much ready and I am double checking the tests.

The last bit of information that I need to know is how you are calling the di_Injector to retrieve this binding. Please share that code line so that I can be certain we have everything correct.

Are you calling for the binding by using the following command di_Injector.Org.getInstance('MEX_UserTriggerHandler'); or was there another way tried to access it??

@ImJohnMDaniel - Thanks for the quick reply.

Here's the sample code segment that we are using:

For trigger:
parameter: SObjectType triggerType
List<di_Binding> bindings = di_Injector.Org.Bindings.bySObject(triggerType).get();

For Classes:
private MEX_UtilityClass actionFromUtility = (MEX_UtilityClass) di_Injector.Org.getInstance(MEX_UtilityClass.class);

@dinobrinas thanks for the info. The changes released to the master branch should fix the issue that you are seeing. If there is still an issue, let us know with a new ticket. Cheers!