Prepopulate fields in Salesforce.com - salesforce

I have a doubt, i've been working with salesforce for a while and now i have a requirement from a customer.
They need that some custom fields be populated with a value of parent object, making some research on stackoverflow, i found this post, but this isn't working for me because my project is a manage package and when this is installed on a another salesforce instance the id of custom field change.
if someone could help me, I will be grateful.
Thanks!.

I can't see any way of doing the same as that post without using the IDs, I was thinking you could route via a VF page and build up the URL in the controller but it doesn't seem as though you can get the IDs of fields, just their type etc..
I think the best you could do in this instance is to override the default new recordpage with a visualforce page. In the constructor of your controller you could then loop through the page parameters and pre-fill the corresponding fields on the new record before it's displayed on screen. Using fieldsets or just an <apex:Detail> component would keep the level of effort down and also maximise the flexibility of the page for the end users.

Related

Using abp-page-toolbar and abp-extensible-table

I am trying to use both components in my angular application. I am a backend developper and absolutely newbie in angular. I have been reading the roles and users components in the source code and I think I cloned it for my Customers component. I have guards, defaults and all the code like Roles and Users but, although the code compiles and the API call is done, I have nothing in the screen, only the Total records are displayed. No action buttons, no table rows, no pagination...
Is there anyone who has use these components and can bring me some help?
Many thanks
Those components are needed for customizing built-in modules. Let's talk about Users for example. The Users component is a built-in page and you do not have access to its code. However, you may still need to make some changes like adding a New User button on the toolbar or changing its columns, form fields etc. That's why ABP Framework provides some injection tokens to override/extend/customize these features. Since you are developing your own page, you do not need any of this. You can directly use ngx-datatable in your own component, add or remove columns and so on.

Salesforce noobie - where are the crud pages for custom objects?

I am a very newbie to SF so pardon my ignorance. I am doing the trailheads and logged into developers org. There I quickly created a custom object with some fields. Now how do I get a CRUD page for the custom object. I have been looking through the documentation and trailheads but I finding everything except this simple step. Can someone please suggest how I can get a CRuD page automatically generated from custom object that I can use to add edit and delete records?
Thanks
You'll need to Create a Tab for your custom object. This tab can be exposed in both Salesforce Classic and Lightning and allows you to create a new record in the object, view list views, and so on.

How to Add Records to 2sxc data from DNNSharp's Action Form

We have DNN Sharp's Action Form being used by client-partners to post new job listings. The Locations and Categories for these jobs are managed in a little 2sxc apps. We want to extend the ActionForm a little so that the user has the ability to add a new Location or Category when they post the job listing.
What method/action would I use in Action Form to be able to add a record to Locations or Categories data which are both inside the 2sxc App?
At the moment there is no quick way, because there is no adapter. You could create some manual code or create an adapter - but that's probably a day or so of work since you probably don't know the Action-Form APIs for all that.
But if you do do it, please share :)
I had a similar project. I wanted a form configuration tool for commonly used forms so that a staff person could fill out date, price etc. without getting under the hood.
I kludged it together using
var formFields;//Angular Controller For Form Fields
formFields = getScope('ActionFormCtrl').form.fields;
Then shoved in my 2SXC values
formFields.EventDate = "#Content.SessionDates";
formFields.$digest();
This is definitely not the angular way but it does work. Note that you need to run the JS after the form is rendered.

in backbone.js can a Model be without any url?

I have an app where the menu system is built dynamically using metadata fetched at startup. Based on this data, and menu selections, I need to craft a "filter box" where user can input search criteria. The "main" View consists of a filter box plus a search results panel where result(s) are rendered in accordance with their classes.
Can I model the Filter Box as a Backbone.js Model? It does not have any data fetches from the backend as its composition depends entirely on the menu selections + the metadata? E.g. when user selects "Sales" menu then the filter box might prompt for "Sales Order Number" whereas when user selects "Material" then the filter box might prompt for something else.
I would then use this widget as component of the "main" View, along with a set of results views made up on the fly. As users make their menu selections, this main View will un-render the existing filter box and recompute and re-render a new one. Other components on the screen could query the Filter Box for its settings.
The examples I have seen so far always have a url and a server fetch, save, etc. The only url-free example on the tutorial page says it is a "contrived" example. I was wondering if a backend provider is necessary and programming will be full of gotchas without conforming to this requirement.
Thanks.
You can have models without url property defined. One of the building blocks of Backbone is the Sync object, that will help you when pulling and pushing data, ideally from/to REST endpoints. For this to work you need to tell where the data are served, and to do so you set a value to url on Models or Collections.
If you don't need server comunication but you just want to use the utilities provided by simple Model or Collection (such as event handling, filtering, etc..) you just don't set url and you are good to go (just keep in mind that methods like fetch or save won't work).
Yes you can use Backbone for your DOM logic too. A model doesn't need to represent data from the server. Do whatever you like with the few basic elements of Backbone, simply use them when you feel like it'd do a great job :)

CakePHP Ajax form - cloning form fields

Using cake 2.2. I currently have a form (built using the form helper) that allows users to add expense claims. Each claim consists of many expenses. So the form contains a row for each expense along with a button that uses jQuery to clone the first row of fields and insert them (with incremented ids/names). The problem is when the form is submitted and there is an error, the cloned fields disappears as the page refreshes (I guess because their not in the dom any more).
The values are still in $this->data so I guess I could manually rebuild them but if I made the form submit by ajax would it solve the problem? IE on error the cloned fields would still remain?
Thanks in advance
Things that are built from Javascript will not retain from one page-load to the next.
Either use Ajax (probably ideal), or build out the fields with PHP based on the supplied data.
Either way is fairly "normal" way of doing it.

Resources