• Ben Merton 17
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 5
    Replies
I am aware that you can add a custom button to the TOP of a related list, but what if I want a button / link that calls a FLOW from each of the line items in the related list?  I have tried creating a hyperlink formula field with the flow but it is not recognising the URL.  Is there any other way to achieve this?
I refer to this question where I have asked a question at the end but think it's best to post separately.

https://developer.salesforce.com/forums/?id=906F00000008jRMIAY

I am creating an app to be used in a managed package, so I won't be able to use the record type id to control the creation of a custom related list button that forces the creation of a specific record type from a related list.

Is there any way to do this by matching the record type text NAME with the child record type NAME?  If the same record type names are used in the parent and the child, can one refer to the parent to drive opening the same child record type?
 
This is linked to this question, but is distinct so I am posting separately:  https://developer.salesforce.com/forums?id=906F0000000BaCvIAK

I am trying to achieve the following function:  On a Purchase Order object, I have a bunch of Tax Line Items.  These are triggered by PO Line Items, meaning that every Purchase Order will have both PO Line Items and their associated Tax Line Items.  The number of taxes for each PO Line Item MAY be as much as five, meaning that each PO could have 5 times the number of PO Line Items.

I therefore need to create a summary object for the Tax Line Items, called Tax Summaries.  I am trying to do this with Visual Flow by using an autolaunched flow that is called from a Workflow when any Tax Line Items is edited/created.  This is working fine for one Tax Line Item.  It correctly loops through all the Tax Line Item records and, based on the attributes, it sums up the Total Tax Amount and inserts it.  Below is a screenshot of the functioning flow:

User-added image

The problem is that I now want the same action above to be performed on all the Tax Line Items relating to a PO, whenever ANY tax line item is updated.  I have tried the following:

1.  Modifying the flow above to include a preceding loop

User-added image

This is giving a bunch of weird errors and I have lost confidence, although it seems like the most likely route that would work.

2.  Creating another flow with a loop that runs through a collection of PO Tax Line Items and calling the flow from there.  This is giving me SOQL limit errors

3.  Trying to run another flow that will update all the Tax Line Items indepedently:

User-added image 

This is giving me a lot of errors like this:  The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30136000000LR6n. Contact your administrator for help., 

I am not sure whether what I am looking for is even possible (it is essentially a workaround on the fact that Visual Flow can't perform the set function).  I have spent hours on this and have lost confidence that ANY of the strategies can even work.

Please help!!!!
 
I am trying to achieve the following function:  On a Purchase Order object, I have a bunch of Tax Line Items.  These are triggered by PO Line Items, meaning that every Purchase Order will have both PO Line Items and their associated Tax Line Items.  The number of taxes for each PO Line Item MAY be as much as five, meaning that each PO could have 5 times the number of PO Line Items.

My concern is what would happen if there were 500 PO Line Items and therefore 2500 Tax Line Items.  Would this hit governor limits on the Workflow being used to create the Tax Line Items from the PO Line Items if they were created with a flow that looks like this:

User-added image
I am trying to create a summary of child records (NOT A ROLL UP) by replicating the set function used in a trigger.

In the child record, I have 
Name:
Attribute:
Amount:

I am looking to loop through all of the child records and sum up the Amount for where the Name and Attribute are the same, and then trigger the result into a parent record.

Is there any Flow workaround for this?
Is it possible to create a text field in Custom Metadata which contains a formula that can then be used in Apex.

I am trying to build a simple tax engine that would refer to metadata fields.  A metadata record would look like this:

Name:  Sales_Tax
Input Variables:  Basic_Price, Sales_Tax_Rate
Output Variable:  Sales_Tax_Amount
Formula:  Sales_Tax_Amount = Basic_Price*Sales_Tax_Rate

Then I would call this into an Apex trigger that updates a field with the Sales_Tax_Amount
Does anyone have any ideas / pointers on the best way to create an app that will manage licenses for a large Schema with 100+ objects, custom settings, metadata etc?

I don't think that the standard License Management app can be used for this?

This will probably need an API call to a third-party system that generates the license keys, and at least one custom Visualforce page.  I was just wondering if anyone had any pointers on how this might work in theory.  In particular, how would you:

1.  Ensure that the license key is secure
2.  Control the visibility of objects and apex code

Thanks for any ideas!
I am trying to create a quite complicated set of objects to drive tax (similar to SAP).

The basic idea is that every tax should have a corresponding formula that defines how the tax is calculated when it is used on another object.  For example, if you may have a tax which is applicable on the base amount or it may be cumulative based on other taxes.

I therefore need to be able to use variables within a formula, but I want this to be configurable by a user.  The best idea I can think of is to use a simple text field in the record of the tax that defines the formulas for how this tax would work on a given object in standard Salesforce point-and-click formulas.

For example, in a text field (called Tax Formula) on the tax record, it would specify something like:

If (Object_Name__c=PO_Line_Item, 
TaxAmount__c=TaxRate__c*BaseAmount__c,
TaxAmount__c=TaxRate__c*(BaseAmount__c-WithholdingTaxAmount))

In the PO Line Item object, I would then want to be able to pull in this point-and-click code and run the formula whenever a record is created.

Is there a method / wrapper or some other type of class that allows the incorporation of standard point-and-click formulas to execute logic?

The alternative to this is that you have to create a custom formula field for every tax scenario for EVERY country that you plan to deploy in.

Any ideas?
I am aware that you can add a custom button to the TOP of a related list, but what if I want a button / link that calls a FLOW from each of the line items in the related list?  I have tried creating a hyperlink formula field with the flow but it is not recognising the URL.  Is there any other way to achieve this?
I am trying to achieve the following function:  On a Purchase Order object, I have a bunch of Tax Line Items.  These are triggered by PO Line Items, meaning that every Purchase Order will have both PO Line Items and their associated Tax Line Items.  The number of taxes for each PO Line Item MAY be as much as five, meaning that each PO could have 5 times the number of PO Line Items.

My concern is what would happen if there were 500 PO Line Items and therefore 2500 Tax Line Items.  Would this hit governor limits on the Workflow being used to create the Tax Line Items from the PO Line Items if they were created with a flow that looks like this:

User-added image
Is it possible to create a text field in Custom Metadata which contains a formula that can then be used in Apex.

I am trying to build a simple tax engine that would refer to metadata fields.  A metadata record would look like this:

Name:  Sales_Tax
Input Variables:  Basic_Price, Sales_Tax_Rate
Output Variable:  Sales_Tax_Amount
Formula:  Sales_Tax_Amount = Basic_Price*Sales_Tax_Rate

Then I would call this into an Apex trigger that updates a field with the Sales_Tax_Amount
I am trying to create a quite complicated set of objects to drive tax (similar to SAP).

The basic idea is that every tax should have a corresponding formula that defines how the tax is calculated when it is used on another object.  For example, if you may have a tax which is applicable on the base amount or it may be cumulative based on other taxes.

I therefore need to be able to use variables within a formula, but I want this to be configurable by a user.  The best idea I can think of is to use a simple text field in the record of the tax that defines the formulas for how this tax would work on a given object in standard Salesforce point-and-click formulas.

For example, in a text field (called Tax Formula) on the tax record, it would specify something like:

If (Object_Name__c=PO_Line_Item, 
TaxAmount__c=TaxRate__c*BaseAmount__c,
TaxAmount__c=TaxRate__c*(BaseAmount__c-WithholdingTaxAmount))

In the PO Line Item object, I would then want to be able to pull in this point-and-click code and run the formula whenever a record is created.

Is there a method / wrapper or some other type of class that allows the incorporation of standard point-and-click formulas to execute logic?

The alternative to this is that you have to create a custom formula field for every tax scenario for EVERY country that you plan to deploy in.

Any ideas?
We have several RecordTypes for our Contacts.  For our "Study Contact" page layout, all the appropriate detail fields are there, and we have a related list that shows Contacts that the current Contact has referred to us.  I want to hide the default New button on this related list and replace it with a "New Referral" button.  Clicking the "New Referral" button should invoke the New action, but set the RecordType to "Study Contact" behind the scenes and bypass the "Select Contact Record Type" page.
 
I have looked everywhere for examples, and managed to put together the following... but it still shows the "Select Contact Record Type" page.   I am putting the RecordType parameter in the parameter array and also including it directly on the URL just in case....  Help?
 
Code:
//First construct the new URL
var newUrl = "{!URLFOR( $Action.Contact.NewContact, null,
[RecordType=Contact.RecordType,
CF00N70000002GKJz_lkid=Contact.Id,
con4_lkid=Account.Id,
retURL=$Request.retURL], true)}&RecordType={!Contact.RecordType}";
//Then redirect the user to it
window.parent.location.replace(newUrl);

This is run in an Execute Javascript button.
I have tried putting the RecordTypeId value in there directly too (rather than use Contact.RecordType), but to no avail.
I'm also trying to automatically link the new Contact with the referrer Contact, and trying to pre-populate the Account ID.
 
Thank you for your help,
Jeff